package org.csmzxyzhl.xyj1510;

public class Example15 {
    public static void main(String[] args) {
        Animal animal = new Cat();
        if (animal instanceof Dog) {
            Dog dog = (Dog) animal;
            dog.houseKeep();
        } else {
            System.out.println("对象类型向下转换不合法");
        }
    }
}